import java.util.Objects;

class MyArray1{
    public Object[] objects=new Object[10];

    public Object getPos(int pos) {
        return objects[pos];
    }

    public void setVail(int pos,Object vail) {
       objects[pos]= vail;
    }
}

class MyArray<T>{
    //public T[] objects=new T[10];
    public T[] objects=(T[]) new Object[10];

    public Object getPos(int pos) {
        return objects[pos];
    }

    public void setVail(int pos,T vail) {
        objects[pos]= vail;
    }
}

public class Test {
    public static void main(String[] args) {
        MyArray<String> myArray=new MyArray<String>();

        //myArray.setVail(0,10);
        myArray.setVail(1,"hello");
        String ret=(String) myArray.getPos(1);

    }

    public static void main1(String[] args) {
        MyArray1 myArray=new MyArray1();
        myArray.setVail(0,10);
        myArray.setVail(1,"hello");
        String ret=(String) myArray.getPos(1);

    }
}
